<template>
    <div class="sys-page">
        <template v-if="showReceiptList">
            <receipt-list></receipt-list>
        </template>
        <template v-else>
            <order-search></order-search>
        </template>
    </div>
</template>

<script>
    import ReceiptList from './receipt_list'
    import OrderSearch from './order_search';
    import { mapState, mapActions } from 'vuex'

    export default {
        name: "receipt",
        components: {OrderSearch, ReceiptList},

        mounted() {
            this.loadInitPageData()
        },

        methods: {
            ...mapActions({
                loadInitPageData: 'receipt/loadInitPageData',
            }),
        },

        computed: {
            ...mapState({
                showReceiptList: state => state.receipt.showReceiptList
            })
        }
    }
</script>

